﻿<%@ Page Title="" Language="C#" MasterPageFile="~/News.master" AutoEventWireup="true"
    CodeFile="News.aspx.cs" Inherits="News" %>

<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="first_xh">
        <span class="cateLvl0">
            <asp:HyperLink ID="HplCha" runat="server"></asp:HyperLink></span> <span class="cateLvl1">
                <asp:HyperLink ID="HplCon" runat="server"></asp:HyperLink></span>
    </div>
    <br class="clear">
    <asp:Panel ID="PanelNewIn" runat="server">
        <asp:DataList ID="DataList1" runat="server">
            <ItemTemplate>
                <div class="newsContent">
                    <div class="bold">
                    </div>
                    <div class="newsContent-title">
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("Title").ToString() %>'></asp:Label></div>
                    <div class="newsContent-time">
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("DatePage").ToString() %>'></asp:Label></div>
                    <div id="newsContent" iwords="true" class="newsContent-content">
                        <p align="justify">
                            <span style="font-family: arial; font-size: 13px;"><strong>
                                <asp:Label ID="Label3" runat="server" Text='<%# Eval("Header").ToString() %>'></asp:Label></strong></span></p>
                        <p align="justify" id="ContentImage">
                            <span style="font-family: arial; font-size: 13px;">
                                <asp:Label ID="Label4" runat="server" Text='<%# Eval("ConTent").ToString() %>'></asp:Label></span></p>
                        <%--scrpit thay doi kich thuoc anh hien thi trong content--%>
                        <script type="text/javascript">
                            function getElements() {
                                var x = document.getElementById('ContentImage').getElementsByTagName("IMG");
                                for (i = 1; i < document.images.length; i++) {
                                    if (document.images[i].width > 465) {
                                        document.images[i].style.width = 460 + "px";
                                    }
                                }
                            }
                            window.onload = getElements();
                        </script>
                    </div>
                </div>
            </ItemTemplate>
        </asp:DataList>
        <div class="panel2">
            <div class="pnl-top">
                <div>
                    <div>
                        <a class="pnl-button none xahoi1" onclick="showSendNews(event, 'tamsu')" href="javascript:void(0)">
                            GỬI TÂM SỰ</a> <a class="pnl-button none xahoi2">GỬI THẢO LUẬN</a> <a class="pnl-title">
                                PHẢN HỒI ĐỘC GIẢ VỀ BÀI VIẾT</a>
                    </div>
                </div>
            </div>
            <div class="wapper forminput">
                <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                    <ProgressTemplate>
                        <p>
                            Vui lòng đợi</p>
                    </ProgressTemplate>
                </asp:UpdateProgress>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Panel ID="Panelphanhoi" runat="server">
                            <p>
                                <span class="label"><i class="red">
                                    <asp:Label ID="lblPhanHoi" runat="server"></asp:Label>
                                </i></span>
                            </p>
                        </asp:Panel>
                        <asp:Panel ID="PanelComment" runat="server">
                            <p class="red">
                                <span id="lblAlert"></span>
                            </p>
                            <p>
                                <span class="label">Họ tên*:</span>&nbsp;<asp:TextBox ID="txtSenderName" CssClass="text w150" runat="server"></asp:TextBox>
                                <span class="label right w65">E-mail*: </span>
                                <asp:TextBox ID="txtSenderEmail" CssClass="text w150" runat="server"></asp:TextBox>
                            </p>
                            <p>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSenderName"
                                    ErrorMessage="(*) Bạn phải nhập Họ tên" ValidationGroup="sendcv" ForeColor="#FF3300"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtSenderEmail"
                                    ErrorMessage="(*) Địa chỉ E-Mail không hợp lệ" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                    ValidationGroup="sendcv" ForeColor="#FF3300"></asp:RegularExpressionValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtSenderEmail"
                                    ErrorMessage="(*) Bạn phải nhập email" ValidationGroup="sendcv" ForeColor="#FF3300"></asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <span class="label">Tiêu đề:</span>
                                <asp:TextBox ID="txtSenderHeader" CssClass="text w300" runat="server" 
                                    Width="360px"></asp:TextBox>
                            </p>
                            <p>
                                <span class="label"><b>Nội dung</b> <i class="red">(Vui lòng gõ tiếng Việt có dấu. Ban
                                    biên tập
                                    <asp:Label ID="lblTenweb" runat="server"></asp:Label>
                                    có thể sẽ biên tập nội dung phản hồi của quý vị cho phù hợp với tiêu chí chung của
                                    toà soạn):</i> </span>
                            </p>
                            <p>
                                <asp:TextBox ID="txtSenderContent" CssClass="textarea" Columns="20" Rows="2" runat="server"
                                    TextMode="MultiLine"></asp:TextBox>
                            </p>
                            <p>
                                <asp:Image ID="imgCaptcha" runat="server" ImageUrl="captcha.aspx" AlternateText="captchar" />
                                <a class="capcha-refresh" href="javascript:void(0)" OnClick="a()">
                                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/refresh.png" />
                                </a>
                               <br />
                                <asp:TextBox runat="server" ID="txtCaptchar" />
                                <br />
                                <asp:Label runat="server" ID="lblMessage" ForeColor="Red" />
                                <script type="text/javascript">
                                    function a() {

                                        $('#ContentPlaceHolder1_imgCaptcha').attr('src', 'captcha.aspx?' + Math.random());

                                    }
                                </script>
                            </p>
                            <p>
                                <asp:Button ID="btnSubmit" CssClass="button" runat="server" ValidationGroup="sendcv"
                                    Text="Gửi đi" OnClick="btnSubmit_Click" />
                            </p>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <p>
                </p>
                <div class="pnl-top">
                    <div>
                        <div>
                            <a class="pnl-button none xahoi1"></a><a class="pnl-title">Ý KIẾN BẠN ĐỌC</a>
                        </div>
                    </div>
                </div>
                <%=BindComment() %>
            </div>
        </div>
        <div class="panel5">
            <div class="pnl-top-new">
                TIN MỚI:</div>
            <div class="pnl-content">
                <asp:DataList ID="dtlTinMoi" runat="server">
                    <ItemTemplate>
                        <div showlead="true" class="item odd">
                            <a lead="true" href="<%# "News.aspx?id="+ Eval("ID").ToString()  %>">
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("Title").ToString() %>'></asp:Label></a>
                            <i class="small">
                                <asp:Label ID="Label6" runat="server" Text='<%# Eval("DatePage").ToString() %>'></asp:Label></i>
                            <div class="leadContent none">
                                <asp:Label ID="Label1" runat="server" Text='<%# ToolCatChuoi.GetShortReview(Eval("Header").ToString(),40) %>'></asp:Label></div>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            </div>
        </div>
        <!-- end panel5-->
        <div class="panel5">
            <div class="pnl-top-new">
                TIN ĐÃ ĐƯA:
            </div>
            <div class="pnl-content">
                <asp:DataList ID="dtlTinDaDua" runat="server">
                    <ItemTemplate>
                        <div showlead="true" class="item odd">
                            <a lead="true" href="<%# "News.aspx?id="+ Eval("ID").ToString()  %>">
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("Title").ToString() %>'></asp:Label></a>
                            <i class="small">
                                <asp:Label ID="Label6" runat="server" Text='<%# Eval("DatePage").ToString() %>'></asp:Label></i>
                            <div class="leadContent none">
                                <asp:Label ID="Label1" runat="server" Text='<%# ToolCatChuoi.GetShortReview(Eval("Header").ToString(),40) %>'></asp:Label></div>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            </div>
            <%--<div class="right">
                <a href="#">                   
                    <img height="9" width="45" src="Images/xemtiep.gif" alt=""></a>
            </div>--%>
        </div>
        <!-- end panel5-->
    </asp:Panel>
    <asp:Panel ID="PanelNew" runat="server">
        <asp:DataList ID="DataList2" runat="server">
            <ItemTemplate>
                <div class="pnl-content" style="margin-top: 15px; border-bottom: 1px solid #CCC;
                    padding-bottom: 15px;">
                    <div class="pnl-topimg">
                        <a href="<%# "News.aspx?ID="+ Eval("ID").ToString()  %>">
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("LinkImage").ToString() %>'
                                Width="120" Height="89" />
                        </a>
                    </div>
                    <div class="pnl-cnt-in1">
                        <p class="pnl-title">
                            <a href="<%# "News.aspx?ID="+ Eval("ID").ToString()  %>">
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("Title").ToString() %>'></asp:Label></a>
                            <br class="clear">
                            <span style="margin-left: 6px; color: #666;">
                                <asp:Label ID="Label5" runat="server" Text='<%# Eval("DatePage").ToString() %>'></asp:Label></span>
                        </p>
                        <p class="pnl-desc">
                        </p>
                        <div align="justify">
                            <asp:Label ID="Label1" runat="server" Text='<%# ToolCatChuoi.GetShortReview(Eval("Header").ToString(),40) %>'></asp:Label>
                        </div>
                    </div>
                    <br class="clear">
                </div>
            </ItemTemplate>
        </asp:DataList>
        <div class="ds-PhanTrang">
            <cc1:CollectionPager ID="CollectionPager1" runat="server" BackText="Trước" FirstText="Trang đầu"
                LabelText="Trang:" LastText="Trang cuối" NextText="Sau" ResultsFormat="Kết quả từ {0}-{1} (của {2})"
                HideOnSinglePage="False" BackNextLocation="Right" LabelStyle="" PageNumbersDisplay="Numbers"
                PageSize="1" PagingMode="PostBack" ResultsLocation="None" ResultsStyle="" BackNextDisplay="HyperLinks"
                BackNextLinkSeparator="-" PageNumberStyle="">
            </cc1:CollectionPager>
        </div>
    </asp:Panel>
</asp:Content>
